<%inherit file="base.mako" />

<%def name="title()">Email Information</%def>

<%def name="head_tags()">

<style>
.togglebox {
background-color: #CCC;
height: 100px;
max-height: 100px;
-webkit-transition: max-height 1s ease-in-out;
-moz-transition: max-height 1s ease-in-out;
-ms-transition: max-height 1s ease-in-out;
-o-transition: max-height 1s ease-in-out;
}
</style>
<script src="/static/jquery.min.js"></script>
<script>
$(document).ready(function(){
//Hide on load
$(".togglebox").hide();
//slide on click
$("#one").click(function(){
//slide toggle effect
$(".togglebox").slideToggle(600);
return true;
});
});
</script>

</%def>
<link rel="stylesheet" type="text/css" href="/static/css/tables.css" />
<h1>${info.Comment} Scanned on Date ${info.date_added}</h1>
% for r in headers:				
		<h3>Header Information</h3>
		
		
		<table>
			<tbody>
				<tr>
					<td>Date:</td>
					<td>${r.date}</td>
					<td>To:</td>
					<td>${r.to_add}</td>
				</tr>
				<tr>
					<td>From:</td>
					<td>${r.from_add}</td>
					<td>Cc:</td>
					<td>${r.cc_add}</td>
				</tr>
				<tr>
					<td>Subject:</td>
					<td>${r.subject}</td>
					<td>Bcc:</td>
					<td>${r.bcc_add}</td>
				</tr>
			</tbody>
		</table>

		<p>&nbsp;</p>
		
		
		<table>
			<tbody>
				<tr>
					<td>X-Mailer:</td>
					<td>${r.x_mailer}</td>
					<td>Message-Id:</td>
					<td>${r.message_id}</td>
				</tr>
				<tr>
					<td>X-Priority:</td>
					<td>${r.x_priority}</td>
					<td>Count Recipients:</td>
					<td>Coutn rcpts here</td>
				</tr>
			</tbody>
		</table>

		<hr />

% endfor

		
		<h3>Body</h3>
		
		<table>
			<tbody>
				<tr>
					<td class="togglebox">
					% for line in f:
					<p>${line}</p>
					% endfor
					</td>
				</tr>
			</tbody>
		</table>
		
		<p><button id="one">Show Body</button></p>
			
			
		<h3>Hops</h3>
% for h in hops:		
		<p>Received: ${h.hop}</p>
% endfor

		<h3>Links, Images And Iframes</h3>
<div class="tablelayout" >		
		<table>

				<tr>
					<td>Type</td>
					<td>Link</td>
					<td>Cuckoo</td>
				</tr>
% for r in links:				
				<tr>
					<td>${r.link_type}</td>
					<td>${r.address}</td>
					<td><a href="/analyse?ID=${r.msg_id}&sandbox=Cuckoo&type=url&url=${r.address}" onclick="centeredPopup(this.href,'myWindow','200','100','yes');return false" class="button">Cuckoo</a></td>
				</tr>
% endfor

		</table>		
</div>		
		<h3>Attatchments</h3>
<div class="tablelayout" >		
		<table>
				<tr>
					<td>FileName</td>
					<td>MD5</td>
				</tr>
% for r in attatch:				
				<tr>
					<td><a href="/file?ID=${msg_id}&md5=${r.md5}">${r.filename}</a></td>
					<td>${r.md5}</td>
				</tr>
% endfor

		</table>
</div>		

		<p>&nbsp;</p>
		<p><button onClick="window.open('/export?msg_id=${msg_id}')">Package For VM</button></p>
		<p>&nbsp;</p>	
			
		<h3>Yara Rules</h3>
		
<div class="tablelayout" >		
		<table>
				<tr>
					<td>Rule Name</td>
					<td>Description</td>
				</tr>
% for y in yara:				
				<tr>
					<td>${y.rule}</td>
					<td>${y.description}</td>
				</tr>
% endfor
		</table>
</div>
		<p>&nbsp;</p>
		
		
		<h3>Comments</h3>
% for comment in comments:		
		
		<p>Title:  ${comment.title}</p>
		<p>Comment: ${comment.freetext}</p>

% endfor			
<%
next = int(msg_id) + 1
prev = int(msg_id) - 1
%>

			<p style="text-align: center;">
				<a href="/sig/${prev}"> Prev</a> | <a href="/review?ID=${msg_id}&flag=review" onclick="centeredPopup(this.href,'myWindow','500','300','yes');return false" >Review</a>| <a href="/review?ID=${msg_id}&flag=event" onclick="centeredPopup(this.href,'myWindow','500','300','yes');return false" >Event</a>| <a href="/review?ID=${msg_id}&flag=clear" onclick="centeredPopup(this.href,'myWindow','500','300','yes');return false" >Clear</a>| <a href="/sig/${next}">Next</a></p>

		
		
		
